package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by dzw on 2017/12/1.
 * 业务机会登记
 */
@Entity
@Table(name="ec_businesschance")
public class BusinessChance extends BaseFlowEntity {
    private static final long serialVersionUID = 5918197122126526805L;

    /**
     * 客户信息表
     */
    private CustomerInfo customerInfo;
    /**
     * 业务名称 name
     */
    /**
     * 业务成交可能性
     */
    private int possibility;
    /**
     * 预计可签时间
     */
    private Date signDatePlan;
    /**
     * 预计合同金额
     */
    private BigDecimal moneyPlan;
    /**
     * 是否关联洽谈记录 是/否
     */
    private String isRelationTalk;
    /**
     * 洽谈记录
     */
    private List<BusinessTalk> businessTalkList;

    @ManyToOne(fetch = FetchType.LAZY)
    public CustomerInfo getCustomerInfo() {
        return customerInfo;
    }

    public void setCustomerInfo(CustomerInfo customerInfo) {
        this.customerInfo = customerInfo;
    }

    public int getPossibility() {
        return possibility;
    }

    public void setPossibility(int possibility) {
        this.possibility = possibility;
    }

    public Date getSignDatePlan() {
        return signDatePlan;
    }

    public void setSignDatePlan(Date signDatePlan) {
        this.signDatePlan = signDatePlan;
    }

    public BigDecimal getMoneyPlan() {
        return moneyPlan;
    }

    public void setMoneyPlan(BigDecimal moneyPlan) {
        this.moneyPlan = moneyPlan;
    }

    public String getIsRelationTalk() {
        return isRelationTalk;
    }

    public void setIsRelationTalk(String isRelationTalk) {
        this.isRelationTalk = isRelationTalk;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_chance_talk", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="talkId"))
    public List<BusinessTalk> getBusinessTalkList() {
        return businessTalkList;
    }

    public void setBusinessTalkList(List<BusinessTalk> businessTalkList) {
        this.businessTalkList = businessTalkList;
    }
}
